Repository navigation
feat(js_runtime): add multi-source Node version reading - #522
Merged
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
fengmk2
force-pushed
the
improve-js-runtime
branch
from
January 29, 2026 09:51
0e469bd to
901823c
Compare
3 tasks done
fengmk2
force-pushed
the
improve-js-runtime
branch
from
January 29, 2026 10:15
901823c to
256cd9b
Compare
Deploying vite-plus with
|
| Latest commit: |
256cd9b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3f73d7d1.vite-plus.pages.dev |
| Branch Preview URL: | https://improve-js-runtime.vite-plus.pages.dev |
fengmk2
marked this pull request as ready for review
January 29, 2026 13:22
fengmk2
force-pushed
the
improve-js-runtime
branch
from
January 30, 2026 11:30
72c1b11 to
03093b9
Compare
fengmk2
force-pushed
the
improve-js-runtime
branch
from
February 3, 2026 09:26
03093b9 to
e865f32
Compare
fengmk2
force-pushed
the
improve-js-runtime
branch
from
February 3, 2026 10:08
e865f32 to
a166bdb
Compare
fengmk2
changed the base branch from
graphite-base/522
to
02-03-chore_fix_the_build_dependency_order
February 3, 2026 10:09
fengmk2
changed the base branch from
02-03-chore_fix_the_build_dependency_order
to
graphite-base/522
February 3, 2026 10:17
fengmk2
force-pushed
the
improve-js-runtime
branch
from
February 3, 2026 10:18
a166bdb to
2937a7c
Compare
fengmk2
force-pushed
the
graphite-base/522
branch
from
February 3, 2026 10:18
369d292 to
61f1397
Compare
fengmk2
force-pushed
the
improve-js-runtime
branch
from
February 3, 2026 10:19
2937a7c to
5c6ebe7
Compare
Member
|
cursor review |
fengmk2
force-pushed
the
improve-js-runtime
branch
2 times, most recently
from
February 5, 2026 05:53
2da0acc to
9889dde
Compare
Read Node.js version from multiple sources with priority: 1. .node-version file (highest) 2. engines.node in package.json 3. devEngines.runtime in package.json (lowest) Key behaviors: - Only write to .node-version when no version source exists - Always fetch latest LTS from network when no version specified - Warn when resolved version conflicts with lower-priority constraints - node-semver handles partial versions natively (20, 20.18, etc.)
Invalid version strings from .node-version, engines.node, and devEngines.runtime are now ignored with a warning, allowing fallthrough to lower-priority sources or the latest LTS version. The normalize_version function trims whitespace and validates the version as either an exact semver version or a valid range.
…hanges - Add Version Validation section documenting trim and semver validation - Update Version Write-Back section to reflect current behavior (only write when no version source exists) - Add success criteria #19 for invalid version fallthrough behavior
When resolving semver ranges like `^20.19.0 || >=22.12.0`, now prefers LTS versions over non-LTS versions. Previously it would return v25 (non-LTS), but now returns the latest LTS that satisfies the range. Only falls back to non-LTS if no LTS version matches the range. Changes: - Updated resolve_version_from_list to prefer highest LTS version - Updated find_cached_version to cross-reference with version index for LTS status of cached versions - Added tests for LTS preference behavior
When fetching the version index fails due to network errors and a local cache exists (even if expired), log a warning and return the cached version instead of failing. This ensures network issues don't interrupt the normal flow when we have a usable cache fallback.
Add visual feedback when downloading JS runtimes using indicatif crate. Shows download progress with bytes, speed, and ETA in TTY environments. Automatically hidden in CI or when output is piped.
Display what is being downloaded (e.g., "Downloading Node.js v22.13.1...") above the progress bar so users understand what the download is for.
fengmk2
force-pushed
the
improve-js-runtime
branch
from
February 5, 2026 14:50
9889dde to
42c817f
Compare
This was referenced Feb 6, 2026
Brooooooklyn
approved these changes
Feb 7, 2026
Member
Author
wan9chi
added a commit
that referenced
this pull request
Jul 15, 2026
Bumps the `vite-task` git dependency from `cb580c2` to `4003f65`. ## Changes The delta is entirely internal `fspy` (file-access tracking) shared-memory work — no user-facing CLI flags, config fields, or behavior changes, so no docs updates were needed. - **fix(fspy):** use `memfd` for Linux shared memory — automatic file-access tracking on Linux now works in containers and Kubernetes runners with limited `/dev/shm` space ([#523](voidzero-dev/vite-task#523), [#353](voidzero-dev/vite-task#353)) - **perf(fspy):** use sparse Windows shared memory — Windows file-access tracking now uses sparse temporary backing files where supported, avoiding upfront allocation of the full backing file on disk ([#524](voidzero-dev/vite-task#524)) - **refactor(fspy):** own macOS shared-memory mapping ([#526](voidzero-dev/vite-task#526)) - **docs/test(fspy):** document shared-memory facade ownership semantics ([#521](voidzero-dev/vite-task#521)); reproduce constrained dev shm failure ([#522](voidzero-dev/vite-task#522)) The lockfile change reflects this refactor: `fspy` now pulls in `memfd` and drops `shared_memory`. ## Validation - `cargo check --workspace` passes — the new `vite-task` compiles cleanly, confirming no breaking changes on the consuming side (including `vite_cli_snapshots`, which compiles against vite-task's PTY/snapshot test crates). - vite-plus crate tests pass. (One pre-existing, environment-specific stack overflow in `vite_global_cli`'s `unknown_argument_detected_with_pass_as_value_hint` clap-parsing test reproduces identically on `main` and is unrelated to this bump.) - PTY snapshot output is unchanged by the bump; the remaining local snapshot diffs in this sandbox are all environmental (no built `packages/cli/dist`, plus registry TLS/network restrictions), left to CI, which builds the JS CLI and has registry access. ## Changelog Full vite-task CHANGELOG diff: ``https://github.com/voidzero-dev/vite-task/compare/cb580c214bb2314fc1f633a3812782c9b3a1d956...4003f65a3e5e3d957ff81b157e85e6ee41cc59fc#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed`` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- _Generated by [Claude Code](https://claude.ai/code/session_01YERo1yECf81w37US2Gqnow)_ Co-authored-by: Claude <noreply@anthropic.com>
fengmk2
added a commit
that referenced
this pull request
Nov 1, 2026
<!-- claude-projects-attribution: {"github_login":"Brooooooklyn"} -->
_Requested by **Brooklyn** · [project
thread](https://claude.ai/code/project/chan_018s9RxRdtH424j2EhXdzV3N?thread=cmsg_018s9RxRdtH424j2EhXdzV3NQxbeR8Pt7qaqSQwoq9rEFo)_
<!-- routine:prune-tests:duplicate-dev-engines-parse-tests -->
Before: three tests in `vp_shared::package_json` each repeated one case
of a stronger table-style test in the same module, with the same
assertions, so they could only fail together with it.
After: the three tests are gone. Every product mutation that failed one
of them also fails its covering test, before and after the removal. Only
`#[cfg(test)] mod tests` changes.
### Totals
- Files touched: 1.
- Cases deleted: **3 of 135** `vp_shared` unit cases (plus 6 doctests,
unchanged); after: 132. The workspace-wide count could not be collected
(see below).
- Cases merged: 0.
- Net lines: **−33** (+0 / −33).
- Runtime saved: about 0 ms (each deleted case reports `<0.000s>`).
### Removals
1. **`test_malformed_single_entry_parses_as_absent`**: its input
`"runtime": "node@24"` and assertion `runtime.is_none()` are the
`"\"node@24\""` row of `test_parse_field_non_object_values`. M1 (accept
a bare string as a single entry's name) failed both; after the removal
it still fails `test_parse_field_non_object_values`.
2. **`test_malformed_dev_engines_does_not_break_engines_parse`**: a
string `devEngines` next to `engines.node`, with three assertions;
`test_parse_dev_engines_non_object_values` makes the same three for its
`"\"text\""` row (and seven more shapes). M2 (reject a string
`devEngines`) failed both; after, it still fails the covering test.
3. **`test_parse_engines_node`**: `{"engines":{"node":">=20.0.0"}}` with
one assertion, the `engines` half of
`test_parse_both_engines_and_dev_engines` (`engines` and `devEngines`
are independent serde fields). M3 (`#[serde(default, rename =
"engine")]` on `engines`) failed it and 4 others; after, it still fails
`test_parse_both_engines_and_dev_engines`,
`test_parse_dev_engines_non_object_values` and
`test_parse_engines_node_empty`.
Kept after defense: none; every nominee had another test failing on its
mutation.
### Case counts
| file | before | after | delta |
|---|---|---|---|
| `crates/vp_shared/src/package_json.rs` | 27 | 24 | −3 |
| `vp_shared` unit total | 135 | 132 | −3 |
0 failures before and after.
### What ran and what did not
- Ran at `4928bc57` and on this branch: `cargo test -p vp_shared -- -Z
unstable-options --report-time`; the three mutations (each reverted);
`cargo clippy -p vp_shared --all-targets --all-features -- --deny
warnings`; `cargo fmt --all -- --check`; `git diff --check`. All clean.
- To build without `just init` (which clones rolldown),
`packages/cli/binding` was dropped from the workspace members locally;
`Cargo.toml` and `Cargo.lock` were restored and are not in this PR.
- Not run: `just check` / `just test` / `just lint` (they need the
rolldown clone), other crates, Windows, the JS suite and the snapshot
suites. No other file changes.
Open pull requests: none of the 62 open PRs touches this file. Ages:
`test_parse_engines_node` from #522 (2026-02-07), the other two from
#1760 (2026-06-08); none was added for a bug or sits in a permission or
security suite.
To revert: `git revert 261d71b`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf)_
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
fengmk2
pushed a commit
that referenced
this pull request
Nov 5, 2026
…ble (#3355) <!-- claude-projects-attribution: {"github_login":"Brooooooklyn"} --> _Requested by **Brooklyn** · [project thread](https://claude.ai/code/project/chan_018s9RxRdtH424j2EhXdzV3N?thread=cmsg_018s9RxRdtH424j2EhXdzV3NQxbeR8Pt7qaqSQwoq9rEFo)_ <!-- routine:prune-tests:node-version-table --> Before: nine `test_parse_node_version_content_*` tests in `crates/vp_js_runtime/src/dev_engines.rs` each asserted a few input → output pairs for the pure function `parse_node_version_content`, one `#[test]` per group. After: one table-driven `test_parse_node_version_content` holds all 25 rows, its section comments and the "LTS Alias Tests" banner. Each assertion names the input that failed. Nothing is deleted. Only the test module changes. How: each row group was defended by mutating `parse_node_version_content` and reverting. Two mutations failed only one of the old tests, so those rows are kept and the new test carries a comment saying so. ### Totals - Files touched: 1 (test module only). - Cases deleted: 0. Cases folded: 9 into 1, so `vp_js_runtime --lib` goes from 137 to 129. - Net lines: **−15** (+51 / −66). - Runtime saved: about 0 (each old case reported `<0.000s`). ### Mutations (each reverted) | Change | Failed before | Failed after | |---|---|---| | drop `strip_prefix('v')` | 3 of the nine, plus 3 `.nvmrc` tests | the folded test, plus the 3 `.nvmrc` tests | | drop `.trim()` | 3 of the nine | the folded test | | drop the empty-content early return | only `_empty` | the folded test | | lowercase `lts/<codename>` | only `_lts_codename` | the folded test | | drop the `lts/` early return | none | none (see below) | Finding, not changed here: the `lts/` early return has no observable effect, because the `strip_prefix('v')` after it can never match a string starting with `lts/`. ### What ran and what did not - Ran at `a32a8cec` and on this branch: `cargo test -p vp_js_runtime --lib` with `--report-time` (137/137 before, 129/129 after), `cargo clippy -p vp_js_runtime --all-targets -- -D warnings`, `rustfmt --check` and `git diff --check`, all clean. The workspace was loaded without `packages/cli/binding`, which needs the `rolldown/` clone; `Cargo.toml` and `Cargo.lock` are unchanged in this PR. - Not run: the rest of the Rust workspace, JS tests and snapshot tests. Open pull requests: none of the open PRs touches `dev_engines.rs`. Ages: the nine tests were added on 2026-02-07 in #522 and #524. To revert: `git revert 91064a5`. --- _Generated by [Claude Code](https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf)_ Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Read Node.js version from multiple sources with priority:
Key behaviors: